
void envelopePanel( int pOscId, ControlWindow pWindow, int pX, int pY )
{

  Slider       vTmpSlider;

  controlP5.addSlider("Attack " + pOscId, 0, 15, 0, pX, pY, 10, 100 );
  vTmpSlider = (Slider)controlP5.controller("Attack " + pOscId);  
  vTmpSlider.setWindow( pWindow );
  vTmpSlider.setSliderMode( Slider.FLEXIBLE );
  vTmpSlider.showTickMarks(true);
  vTmpSlider.setNumberOfTickMarks(16);
  vTmpSlider.snapToTickMarks(true);
  vTmpSlider.setDecimalPrecision(0);
  vTmpSlider.setId( 5 + 7 * ( pOscId - 1 ) );

  controlP5.addSlider("Decay " + pOscId, 0, 15, 0, pX + 40, pY, 10, 100 );
  vTmpSlider = (Slider)controlP5.controller("Decay " + pOscId);  
  vTmpSlider.setWindow( pWindow );
  vTmpSlider.setSliderMode( Slider.FLEXIBLE );
  vTmpSlider.showTickMarks(true);
  vTmpSlider.setNumberOfTickMarks(16);
  vTmpSlider.snapToTickMarks(true);
  vTmpSlider.captionLabel().style().margin(18,0,0,0);
  vTmpSlider.setDecimalPrecision(0);
  vTmpSlider.setId( 5 + 7 * ( pOscId - 1 ) + 200 );

  controlP5.addSlider("Sustain " + pOscId, 0, 15, 0, pX + 80, pY, 10, 100 );
  vTmpSlider = (Slider)controlP5.controller("Sustain " + pOscId);  
  vTmpSlider.setWindow( pWindow );
  vTmpSlider.setSliderMode( Slider.FLEXIBLE );
  vTmpSlider.showTickMarks(true);
  vTmpSlider.setNumberOfTickMarks(16);
  vTmpSlider.snapToTickMarks(true);
  vTmpSlider.setDecimalPrecision(0);
  vTmpSlider.setId( 6 + 7 * ( pOscId - 1 ) );


  controlP5.addSlider("Release " + pOscId, 0, 15, 0, pX + 120, pY, 10, 100 );
  vTmpSlider = (Slider)controlP5.controller("Release " + pOscId);  
  vTmpSlider.setWindow( pWindow );
  vTmpSlider.setSliderMode( Slider.FLEXIBLE );
  vTmpSlider.showTickMarks(true);
  vTmpSlider.setNumberOfTickMarks(16);
  vTmpSlider.snapToTickMarks(true);
  vTmpSlider.captionLabel().style().margin(18,0,0,0);
  vTmpSlider.setDecimalPrecision(0);
  vTmpSlider.setId( 6 + 7 * ( pOscId - 1 ) + 200 );
}


